package com.ala4.oxcafe.entity;

import com.ala4.oxcafe.core.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

/**
 * 车膜产品表
 *
 * @author PING
 * @version 1.0.0
 * @date 2025/8/14 10:01
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("film_product")
@Schema(description = "字典类型")
public class FilmProduct extends BaseEntity {

    @Schema(description = "主键id")
    @TableId(value = "id", type = IdType.INPUT)
    @NotNull(message = "产品编码不能为空", groups = Update.class)
    private Long id;

    @Schema(description = "产品编码")
    @NotEmpty(message = "产品编码不能为空", groups = Create.class)
    @NotNull(message = "产品编码不能为空", groups = Create.class)
    @Length(min = 5, max = 15, message = "产品编码长度必须在5-15位")
    private String code;

    @Schema(description = "产品名称(品名中文)")
    @NotEmpty(message = "产品中文名称不能为空", groups = Create.class)
    @NotNull(message = "产品中文名称不能为空", groups = Create.class)
    private String nameCn;

    @Schema(description = "产品名称(品名英文)")
    private String nameEn;

    @Schema(description = "产品系列")
    @NotEmpty(message = "产品系列不能为空", groups = Create.class)
    @NotNull(message = "产品系列不能为空", groups = Create.class)
    private String series;

    @Schema(description = "产品类型(形车衣(PPF)/改色膜(Color)/车窗膜(Tint)/其他(Other))")
    private String type;

    @Schema(description = "规格 (如：1.52m x 15m)")
    private String specs;

    @Schema(description = "状态（0在售 1停售）")
    @NotNull(message = "产品状态不能为空", groups = Create.class)
    private Integer status;

    public interface Create {
    }

    public interface Update {
    }
}
